package com.guigu1.ThreadExer;

public class MyThreadTest {

	public static void main(String[] args) {
		Myth1 m = new Myth1();
		m.start();
		Myth2 m2 = new Myth2();
		m2.start();
	}
}

class Myth1 extends Thread
{
	@Override
	public void run() {
		for(int i=0;i<100;i++)
		{
			if(i%2 ==0)
			{
				System.out.println(getName()+":"+i);
			}
		}
	}
}

class Myth2 extends Thread
{
	public void run()
	{
		for(int i=0;i<100;i++)
		{
			if(i%2 !=0)
			{
				System.out.println(getName()+":"+i);
			}
		}
	}
}